package com.isoft.hospital.controller;

import com.isoft.hospital.common.ResponseData;
import com.isoft.hospital.entity.Inhospital;
import com.isoft.hospital.service.InhospitalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class InhospitalController {
    @Autowired
    private InhospitalService service;
    @RequestMapping("selectAllinhospital")
    public ResponseData selectAll(){
        ResponseData rd=service.selectAll();
        return rd;

    }
    @RequestMapping("/insertinhospital")
    public ResponseData insert(Inhospital inhospital){  //department 的封装
        ResponseData rd=service.insert(inhospital);   //与service类关联
        return rd;
    }
    @RequestMapping("/deleteinhospital")
    public ResponseData delete(int ba_id){
        ResponseData rd=service.delete(ba_id);
        return rd;
    }
    @RequestMapping("/updateinhospital")
    public ResponseData update(Inhospital inhospital){
        ResponseData rd =service.update(inhospital); //与service关联
        return rd;

    }
}
